﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DatabaseCore;

namespace SystemCore
{
    public class Common
    {
        #region Singleton of user

        private static tbl_User m_userDto = new tbl_User();
        public static tbl_User UserData
        {
            get { return m_userDto; }
            set { m_userDto = value; }
        }

        public static int Id
        {
            get
            {
                return UserData.Id;
            }
            internal set
            {
                UserData.Id = value;
            }
        }

        public static string Username
        {
            get
            {
                return UserData.UserName ?? "Guest";
            }
            internal set
            {
                UserData.UserName = value;
            }
        }

        public static string Email
        {
            get
            {
                return UserData.Email;
            }
            internal set
            {
                UserData.Email = value;
            }
        }

        public static string FullName
        {
            get
            {
                return UserData.FullName ?? "Guest";
            }
            internal set
            {
                UserData.FullName = value;
            }
        }

        public static int Role
        {
            get
            {
                return UserData.Role;
            }
            internal set
            {
                UserData.Role = value;
            }
        }

        //public static string RoleName
        //{
        //    get
        //    {
        //        return UserData.tbl_Role == null ? "Guest" : UserData.tbl_Role.Name;
        //    }
        //}



        #endregion

        public static Color COLOR_NORMAL_BG = Color.White;
        public static Color COLOR_NORMAL_FG = Color.Black;

        public static Color COLOR_READONLY_BG = Color.FromArgb(236, 247, 243);
        public static Color COLOR_READONLY_FG = Color.Black;
    }
}
